<?php

error_reporting(E_ALL);

defined('MIKROTIK_PATH') or define('MIKROTIK_PATH',dirname(__FILE__).DIRECTORY_SEPARATOR.'mikrotik'.DIRECTORY_SEPARATOR);
 
//load parent core
require_once MIKROTIK_PATH .'core/core.php';

//load child class interface
require_once MIKROTIK_PATH . 'interface/MInterfaces.php';

//load child class ip
require_once MIKROTIK_PATH . 'ip/MIp.php';

//load child class ppp
require_once MIKROTIK_PATH . 'ppp/MPpp.php';

// load child class system
require_once MIKROTIK_PATH . 'system/MSscheduler.php';
require_once MIKROTIK_PATH . 'system/Msystem.php';

//load child class file
require_once MIKROTIK_PATH . 'file/MFile.php';

/**
 * Description of Mikrotik_Api
 * @author      Virtual Think Team vthinkteam@gmail.com <http://vthink.web.id>
 * @author      Lalu Erfandi Maula Yusnu nunenuh@gmail.com <http://vthink.web.id>
 * @author      Krisna Pranata krisna.pranata@gmail.com <http://vthink.web.id>
 * @copyright   Copyright (c) 2011, Virtual Think Team.
 * @license     http://www.apache.org/licenses/LICENSE-2.0.html
 * @category	Extensions
 * 
 * @property string $ip
 * @property string $address
 * @property string $Mrs
 */
class Mikrotikapi {		
   

    public  static function talker(){
    	return new Talker(Yii::app()->params['Mikrotik']['address'], Yii::app()->params['Mikrotik']['port'], Yii::app()->params['Mikrotik']['username'], Yii::app()->params['Mikrotik']['password']);
    }
    
    /**
     * This method for call class Mapi IP
     * @access public
     * @return Object of Mapi_Ip 
     */
    public static function ip(){
        return new MIp(self::talker());
    }
    
    /**
     * This method for call class Mapi Interface
     * @access public
     * @return Object of Mapi_Interface 
     */
    public static function interfaces(){
        return new MInterfaces(self::talker()); 
    }
    
    /**
     * This method for call class Mapi Ppp
     * @access public
     * @return Object of Mapi_Ppp
     */
    public static function ppp(){
        return new MPpp(self::talker());
    }
    
    /**
     * This method for call class Mapi_System
     * @access public
     * @return Mapi_System 
     */
    public static function system(){
        return new MSystem(self::talker());
    }
    
    /**
     * This method for call class Mapi_File
     * @access public
     * @return Mapi_File 
     */
    public static function file(){
        return new MFile(self::talker());
    }
    
    /**
     * This metod used call class Mapi_System_Scheduler 
     * @return Mapi_Ip
     */
    public static function system_scheduler(){
        return new MSscheduler(self::talker());
    }    

}